<h1>Leave Types</h1>

<?= $this->element('list', array(
	'entity' => 'LeaveType',
	'data'   => $leaveTypes,
	'fields' => array(
		'Id'    => 'LeaveType.id',
		'Name'  => 'LeaveType.name',
		'Rules' => function($row) {
			$rules = Set::extract('{n}.rule', $row['LeaveTypeRule']);
			if (empty($rules)) {
			    $rules = array();
			}
			return implode(", ", $rules);
		}
	)
)) ?>